﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Tong;
public partial class aspnet_testPargrameDir_site_Case : System.Web.UI.Page
{    /// <summary>
    /// 用於顯示資料
    /// </summary>
    public Tong.TongUse TextData = new Tong.TongUse();

    /// <summary>
    /// 系统安装绝对路径
    /// </summary>
    public string Abs_Path = TongUse.SysPath;
    /// <summary>
    /// 用户存放数据的临时表
    /// </summary>
    DataTable MyDt = new DataTable();


    /// <summary>
    /// 站点通用方法类
    /// </summary>
    public Tong.ThisSiteUse.SiteTong TextThisSite = new Tong.ThisSiteUse.SiteTong();


    //得到传入的栏目ID
    public String CloumnID = "3"; 

    /// <summary>
    /// 顯示當前欄目的簡介
    /// </summary>
    public string str1 = "";
    /// <summary>
    /// 資料表
    /// </summary>
    DataTable NewDt = new DataTable();
    public int II = 1;
    /// <summary>
    /// 顯示資料
    /// </summary>
    public string[] str = new string[]{"A","B","C","D","E","F","G","H","I","J","K","l","M","N","O","P"};
    protected void Page_Load(object sender, EventArgs e)
    {
        BindData();
      
    }

    /// <summary>
    ///邦定當前頁面的資料
    /// </summary>
    void BindData()
    {
        try
        {
            CloumnID = Request.QueryString["CloumnID"].Trim();
            CloumnID=Request.QueryString["SendentID"].Trim();

        }
        catch
        {
            try
            {
               NewDt = TextData.SqlataSet("select  * from [CX_Column] where CX_Column_id="+CloumnID).Tables[0];
               Descripation.Text = NewDt.Rows[0]["CX_Column_Explair"].ToString();
               Pic.Src = NewDt.Rows[0]["CX_Column_Pic"].ToString();
               NewDt.Clear();
               NewDt.Dispose();

                CloumnID = Request.QueryString["CloumnID"].Trim();

            }
            catch
            {
                CloumnID = "3";
            }
        }

        MyDt = TextData.SqlataSet("select  * from [CX_Column] where CX_Column_followid=" + CloumnID + "  order by CX_Column_Sort desc,CX_Column_id desc ").Tables[0];
        MainCase.DataSource = MyDt;
        MainCase.DataBind();
    }


    /// <summary>
    /// 帮定大栏目
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void ShowClass1_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            Repeater MyRe = ((Repeater)e.Item.FindControl("Cases"));
            //得到欄目ＩＤ
            string CID = DataBinder.Eval(e.Item.DataItem, Tong.DataOperation.Data_CX_Column._CX_Column_id).ToString();
            DataTable ShowClassTable = TextThisSite.GetPointCloumnNews(CID, 888, "2");
            MyRe.DataSource = ShowClassTable;
            MyRe.DataBind();

        }
    }
}
